package com.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.service.UserBindService;
import com.util.LoggerUtil;

@Controller
@RequestMapping("/userBindController")
public class UserBindController {

	@Autowired
	private UserBindService userBindService;
	@RequestMapping(value="insertUserBind",method={RequestMethod.GET,RequestMethod.POST})
	@ResponseBody
	public Map<String, Object> insertUserBind(String mId,String wId,String gender,String mobile,String lId,String type,Integer age,String name,HttpServletRequest request){
		JSONObject logs=JSONObject.fromObject(LoggerUtil.getParams(request));
		logs.put("mId", mId);
		logs.put("wId", wId);
		logs.put("gender", gender);
		logs.put("mobile", mobile);
		logs.put("lId", lId);
		logs.put("type", type);
		logs.put("age", age);
		logs.put("name", name);
		return userBindService.insertUserBind(mId, wId, gender, mobile,lId,type,age, name,logs);
	}
}
